package com.woniu.service.imple;

import com.woniu.adapter.CompanyAdapter;
import com.woniu.outlet.po.Associates;
import com.woniu.outlet.po.Company;
import com.woniu.outlet.po.CompanyExtend;
import com.woniu.outlet.po.CompanyKeyPerson;
import com.woniu.service.ICompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CompanyService implements ICompanyService {

    @Autowired
    private CompanyAdapter companyAdapter;

    //添加正式客户的信息
    @Override
    public int addregularcustomer(Company company) {
        int addregularcustomer = companyAdapter.addregularcustomer(company);
        return addregularcustomer;
    }

    //修改企业客户表（主表：company）的具体信息
    @Override
    public int updatecompany(Company company) {
        int updatecompany = companyAdapter.updatecompany(company);
        return updatecompany;
    }

    //修改企业的扩展表companyextend
    @Override
    public int updatecompanyextend(CompanyExtend companyExtend) {
        int updatecompanyextend = companyAdapter.updatecompanyextend(companyExtend);
        return updatecompanyextend;
    }

    //修改联系人的信息
    @Override
    public int updatecompanykeyperson(CompanyKeyPerson companyKeyPerson) {
        int updatecompanykeyperson = companyAdapter.updatecompanykeyperson(companyKeyPerson);
        return updatecompanykeyperson;
    }

    //修改关联企业的信息
    @Override
    public int updateassociate(Associates associates) {
        int updateassociate = companyAdapter.updateassociate(associates);
        return updateassociate;
    }

    //添加关联企业的信息，一般而言一个企业的关联企业是一对多的关系
    @Override
    public int addassociate(Associates associates) {
        int addassociate = companyAdapter.addassociate(associates);
        return addassociate;
    }
}
